package com.jsbj.user.controller;


import com.alibaba.fastjson.JSONObject;
import com.jsbj.base.ResultBean;
import com.jsbj.user.entities.SysEquFieldConfig;
import com.jsbj.user.service.ISysEquFieldConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 设备表 前端控制器
 * </p>
 *
 * @author jsbj
 * @since 2023-01-04
 */
@RestController
@RequestMapping("/sys-equ-field-config")
@Api(value = "设备字段配置表", tags = "设备字段配置表")
public class SysEquFieldConfigController {

    @Autowired
    private ISysEquFieldConfigService sysEquFieldConfigService;

    @ApiOperation("通过项目编码、标段编码、系统编码、设备类型、字段类型查询设备字段列表")
    @PostMapping("/getByCondition")
    public ResultBean<List<SysEquFieldConfig>> getByCondition(@RequestBody String inputParam) {
        JSONObject object = JSONObject.parseObject(inputParam);
        return new ResultBean<List<SysEquFieldConfig>>(sysEquFieldConfigService.getByCondition(object));
    }
}

